package com.hansming.bss.modules.sfc.dao;

import org.apache.ibatis.annotations.Param;

import com.hansming.bss.common.persistence.CrudDao;
import com.hansming.bss.common.persistence.annotation.MyBatisDao;
import com.hansming.bss.modules.sfc.entity.Bindpcinfo;
import com.hansming.bss.modules.sfc.entity.Customer;

/**
 * 顾客用户Dao接口
 * @author Hansming
 * @version 2017-09-15
 */
@MyBatisDao
public interface CustomerDao extends CrudDao<Customer>{
	
	public Customer findCustomerByEmail(String email,String password);
	
	public Customer findCustomerByPhone(String phone,String password);
	
	public Customer checkEmail(String email);
	
	
	public void activate(String id);
	
	public void savecustomerbyid(@Param("id")String id,@Param("name")String name,@Param("score")Integer score,@Param("del_flag")String del_flag);
	
	public void updatescore(Customer customer);
	
	//检测手机号码是否重复
	public int checkphone(@Param("phone")String phone);
	
	//检测邮箱是否重复
	public int checkemail(@Param("email")String email);
	
	//登录
	public Customer login(@Param("phone")String phone,@Param("email")String email,@Param("password")String password);
	
	
	//根据用户pcuserid查找用户
	public Customer selectbypcuserid(@Param("pcuserid")String pcuserid);
	
	//根据PcUser的token查找到对应用户的信息
	public Customer selectbypcusertoken(@Param("token")String token);
	
	
	public int savecustomer(Customer customer);
	
	public Bindpcinfo selectBindinfoByPcUserId(@Param("pcuserid")String pcuserid);
	
}
